<button nz-button [nzType]="'primary'" (click)="newRow()" acl [acl-ability]="102">
    <i nz-icon nzType="plus"></i>
    <span>{{ 'button.new' | i18n }}</span>
  </button>

  <button nz-button [nzType]="'primary'" nzDanger="true" (click)="saveRow()" acl [acl-ability]="102">
    <i nz-icon nzType="save"></i>
    <span>{{ 'button.save' | i18n }}</span>
  </button>
  <st #st [data]="dictionaryData" [columns]="columns">



    <ng-template st-row="keyNameTpl" let-item let-index="index">
      <input *ngIf="item.edit" nz-input [ngModel]="item.keyName"
        (ngModelChange)="st.setRow(index, { keyName: $event })" />
      <ng-container *ngIf="!item.edit">{{ item.keyName }}</ng-container>
    </ng-template>
   
    <ng-template st-row="displayNameTpl" let-item let-index="index">
        <input *ngIf="item.edit" nz-input [ngModel]="item.displayName"
          (ngModelChange)="st.setRow(index, { displayName: $event })" />
        <ng-container *ngIf="!item.edit">{{ item.displayName }}</ng-container>
      </ng-template>

      <ng-template st-row="unitTpl" let-item let-index="index">
        <input *ngIf="item.edit" nz-input [ngModel]="item.unit"
          (ngModelChange)="st.setRow(index, { unit: $event })" />
        <ng-container *ngIf="!item.edit">{{ item.unit }}</ng-container>
      </ng-template>

      <ng-template st-row="unitExpressionTpl" let-item let-index="index">
        <input *ngIf="item.edit" nz-input [ngModel]="item.unitExpression"
          (ngModelChange)="st.setRow(index, { unitExpression: $event })" />
        <ng-container *ngIf="!item.edit">{{ item.unitExpression }}</ng-container>
      </ng-template>


      <ng-template st-row="unitConvertTpl" let-item let-index="index">
      <nz-switch [ngModel]="item.unitConvert" *ngIf="item.edit"
       (ngModelChange)="st.setRow(index, { unitConvert: $event })"></nz-switch> 
        <ng-container *ngIf="!item.edit">{{ item.unitConvert }}</ng-container>
      </ng-template>


      
      <ng-template st-row="keyDescTpl" let-item let-index="index">
        <input *ngIf="item.edit" nz-input [ngModel]="item.keyDesc"
          (ngModelChange)="st.setRow(index, { keyDesc: $event })" />
        <ng-container *ngIf="!item.edit">{{ item.keyDesc }}</ng-container>
      </ng-template>
      <ng-template st-row="defaultValueTpl" let-item let-index="index">
        <input *ngIf="item.edit" nz-input [ngModel]="item.defaultValue"
          (ngModelChange)="st.setRow(index, { defaultValue: $event })" />
        <ng-container *ngIf="!item.edit">{{ item.defaultValue }}</ng-container>
      </ng-template>



      
      <ng-template st-row="displayTpl" let-item let-index="index">
        <nz-switch [ngModel]="item.display" *ngIf="item.edit"
         (ngModelChange)="st.setRow(index, { display: $event })"></nz-switch> 
          <ng-container *ngIf="!item.edit">{{ item.display }}</ng-container>
        </ng-template>
  

        <ng-template st-row="place0Tpl" let-item let-index="index">
            <input *ngIf="item.edit" nz-input [ngModel]="item.place0"
              (ngModelChange)="st.setRow(index, { place0: $event })" />
            <ng-container *ngIf="!item.edit">{{ item.place0 }}</ng-container>
          </ng-template>



          <ng-template st-row="tagtpl" let-item let-index="index">
            <input *ngIf="item.edit" nz-input [ngModel]="item.tag"
              (ngModelChange)="st.setRow(index, { tag: $event })" />
            <ng-container *ngIf="!item.edit">{{ item.tag }}</ng-container>
          </ng-template>


    <ng-template st-row="dataTypeTpl" let-item let-index="index">
      <nz-select *ngIf="item.edit" [ngModel]="item.dataType"
        (ngModelChange)="st.setRow(index, { dataType: $event })">
        <nz-option nzValue="Boolean" nzLabel="Boolean"></nz-option>
        <nz-option nzValue="String" nzLabel="String"></nz-option>
        <nz-option nzValue="Long" nzLabel="Long"></nz-option>
        <nz-option nzValue="Double" nzLabel="Double"></nz-option>
        <nz-option nzValue="Json" nzLabel="Json"></nz-option>
        <nz-option nzValue="XML" nzLabel="XML"></nz-option>
        <nz-option nzValue="Binary" nzLabel="Binary"></nz-option>
        <nz-option nzValue="DateTime" nzLabel="DateTime"></nz-option>
      </nz-select>

      <ng-container *ngIf="!item.edit">{{ item.dataType}}</ng-container>
    </ng-template>


  </st>